using System; 
using System.Text; 
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration; 
using System.Xml; 
using System.Xml.Serialization;
using SubSonic; 
using SubSonic.Utilities;
namespace WaEvent.Generated
{
	/// <summary>
	/// Strongly-typed collection for the IEvent class.
	/// </summary>
    [Serializable]
	public partial class IEventCollection : ActiveList<IEvent, IEventCollection>
	{	   
		public IEventCollection() {}
        
        /// <summary>
		/// Filters an existing collection based on the set criteria. This is an in-memory filter
		/// Thanks to developingchris for this!
        /// </summary>
        /// <returns>IEventCollection</returns>
		public IEventCollection Filter()
        {
            for (int i = this.Count - 1; i > -1; i--)
            {
                IEvent o = this[i];
                foreach (SubSonic.Where w in this.wheres)
                {
                    bool remove = false;
                    System.Reflection.PropertyInfo pi = o.GetType().GetProperty(w.ColumnName);
                    if (pi.CanRead)
                    {
                        object val = pi.GetValue(o, null);
                        switch (w.Comparison)
                        {
                            case SubSonic.Comparison.Equals:
                                if (!val.Equals(w.ParameterValue))
                                {
                                    remove = true;
                                }
                                break;
                        }
                    }
                    if (remove)
                    {
                        this.Remove(o);
                        break;
                    }
                }
            }
            return this;
        }
		
		
	}
	/// <summary>
	/// This is an ActiveRecord class which wraps the iEvent table.
	/// </summary>
	[Serializable]
	public partial class IEvent : ActiveRecord<IEvent>, IActiveRecord
	{
		#region .ctors and Default Settings
		
		public IEvent()
		{
		  SetSQLProps();
		  InitSetDefaults();
		  MarkNew();
		}
		
		private void InitSetDefaults() { SetDefaults(); }
		
		public IEvent(bool useDatabaseDefaults)
		{
			SetSQLProps();
			if(useDatabaseDefaults)
				ForceDefaults();
			MarkNew();
		}
        
		public IEvent(object keyID)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByKey(keyID);
		}
		 
		public IEvent(string columnName, object columnValue)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByParam(columnName,columnValue);
		}
		
		protected static void SetSQLProps() { GetTableSchema(); }
		
		#endregion
		
		#region Schema and Query Accessor	
		public static Query CreateQuery() { return new Query(Schema); }
		public static TableSchema.Table Schema
		{
			get
			{
				if (BaseSchema == null)
					SetSQLProps();
				return BaseSchema;
			}
		}
		
		private static void GetTableSchema() 
		{
			if(!IsSchemaInitialized)
			{
				//Schema declaration
				TableSchema.Table schema = new TableSchema.Table("iEvent", TableType.Table, DataService.GetInstance("WaEvent"));
				schema.Columns = new TableSchema.TableColumnCollection();
				schema.SchemaName = @"dbo";
				//columns
				
				TableSchema.TableColumn colvarId = new TableSchema.TableColumn(schema);
				colvarId.ColumnName = "Id";
				colvarId.DataType = DbType.Int32;
				colvarId.MaxLength = 0;
				colvarId.AutoIncrement = true;
				colvarId.IsNullable = false;
				colvarId.IsPrimaryKey = true;
				colvarId.IsForeignKey = false;
				colvarId.IsReadOnly = false;
				colvarId.DefaultSetting = @"";
				colvarId.ForeignKeyTableName = "";
				schema.Columns.Add(colvarId);
				
				TableSchema.TableColumn colvarTitle = new TableSchema.TableColumn(schema);
				colvarTitle.ColumnName = "Title";
				colvarTitle.DataType = DbType.String;
				colvarTitle.MaxLength = 500;
				colvarTitle.AutoIncrement = false;
				colvarTitle.IsNullable = true;
				colvarTitle.IsPrimaryKey = false;
				colvarTitle.IsForeignKey = false;
				colvarTitle.IsReadOnly = false;
				colvarTitle.DefaultSetting = @"";
				colvarTitle.ForeignKeyTableName = "";
				schema.Columns.Add(colvarTitle);
				
				TableSchema.TableColumn colvarEventDate = new TableSchema.TableColumn(schema);
				colvarEventDate.ColumnName = "EventDate";
				colvarEventDate.DataType = DbType.DateTime;
				colvarEventDate.MaxLength = 0;
				colvarEventDate.AutoIncrement = false;
				colvarEventDate.IsNullable = true;
				colvarEventDate.IsPrimaryKey = false;
				colvarEventDate.IsForeignKey = false;
				colvarEventDate.IsReadOnly = false;
				colvarEventDate.DefaultSetting = @"";
				colvarEventDate.ForeignKeyTableName = "";
				schema.Columns.Add(colvarEventDate);
				
				TableSchema.TableColumn colvarDescription = new TableSchema.TableColumn(schema);
				colvarDescription.ColumnName = "Description";
				colvarDescription.DataType = DbType.String;
				colvarDescription.MaxLength = 1073741823;
				colvarDescription.AutoIncrement = false;
				colvarDescription.IsNullable = true;
				colvarDescription.IsPrimaryKey = false;
				colvarDescription.IsForeignKey = false;
				colvarDescription.IsReadOnly = false;
				colvarDescription.DefaultSetting = @"";
				colvarDescription.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDescription);
				
				TableSchema.TableColumn colvarHostedBy = new TableSchema.TableColumn(schema);
				colvarHostedBy.ColumnName = "HostedBy";
				colvarHostedBy.DataType = DbType.String;
				colvarHostedBy.MaxLength = 500;
				colvarHostedBy.AutoIncrement = false;
				colvarHostedBy.IsNullable = true;
				colvarHostedBy.IsPrimaryKey = false;
				colvarHostedBy.IsForeignKey = false;
				colvarHostedBy.IsReadOnly = false;
				colvarHostedBy.DefaultSetting = @"";
				colvarHostedBy.ForeignKeyTableName = "";
				schema.Columns.Add(colvarHostedBy);
				
				TableSchema.TableColumn colvarPhone = new TableSchema.TableColumn(schema);
				colvarPhone.ColumnName = "Phone";
				colvarPhone.DataType = DbType.String;
				colvarPhone.MaxLength = 50;
				colvarPhone.AutoIncrement = false;
				colvarPhone.IsNullable = true;
				colvarPhone.IsPrimaryKey = false;
				colvarPhone.IsForeignKey = false;
				colvarPhone.IsReadOnly = false;
				colvarPhone.DefaultSetting = @"";
				colvarPhone.ForeignKeyTableName = "";
				schema.Columns.Add(colvarPhone);
				
				TableSchema.TableColumn colvarAddress = new TableSchema.TableColumn(schema);
				colvarAddress.ColumnName = "Address";
				colvarAddress.DataType = DbType.String;
				colvarAddress.MaxLength = 50;
				colvarAddress.AutoIncrement = false;
				colvarAddress.IsNullable = true;
				colvarAddress.IsPrimaryKey = false;
				colvarAddress.IsForeignKey = false;
				colvarAddress.IsReadOnly = false;
				colvarAddress.DefaultSetting = @"";
				colvarAddress.ForeignKeyTableName = "";
				schema.Columns.Add(colvarAddress);
				
				TableSchema.TableColumn colvarLat = new TableSchema.TableColumn(schema);
				colvarLat.ColumnName = "Lat";
				colvarLat.DataType = DbType.Decimal;
				colvarLat.MaxLength = 0;
				colvarLat.AutoIncrement = false;
				colvarLat.IsNullable = true;
				colvarLat.IsPrimaryKey = false;
				colvarLat.IsForeignKey = false;
				colvarLat.IsReadOnly = false;
				colvarLat.DefaultSetting = @"";
				colvarLat.ForeignKeyTableName = "";
				schema.Columns.Add(colvarLat);
				
				TableSchema.TableColumn colvarLng = new TableSchema.TableColumn(schema);
				colvarLng.ColumnName = "Lng";
				colvarLng.DataType = DbType.Decimal;
				colvarLng.MaxLength = 0;
				colvarLng.AutoIncrement = false;
				colvarLng.IsNullable = true;
				colvarLng.IsPrimaryKey = false;
				colvarLng.IsForeignKey = false;
				colvarLng.IsReadOnly = false;
				colvarLng.DefaultSetting = @"";
				colvarLng.ForeignKeyTableName = "";
				schema.Columns.Add(colvarLng);
				
				TableSchema.TableColumn colvarCountryId = new TableSchema.TableColumn(schema);
				colvarCountryId.ColumnName = "CountryId";
				colvarCountryId.DataType = DbType.Int32;
				colvarCountryId.MaxLength = 0;
				colvarCountryId.AutoIncrement = false;
				colvarCountryId.IsNullable = true;
				colvarCountryId.IsPrimaryKey = false;
				colvarCountryId.IsForeignKey = false;
				colvarCountryId.IsReadOnly = false;
				colvarCountryId.DefaultSetting = @"";
				colvarCountryId.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCountryId);
				
				TableSchema.TableColumn colvarCategoryId = new TableSchema.TableColumn(schema);
				colvarCategoryId.ColumnName = "CategoryId";
				colvarCategoryId.DataType = DbType.Int32;
				colvarCategoryId.MaxLength = 0;
				colvarCategoryId.AutoIncrement = false;
				colvarCategoryId.IsNullable = true;
				colvarCategoryId.IsPrimaryKey = false;
				colvarCategoryId.IsForeignKey = true;
				colvarCategoryId.IsReadOnly = false;
				colvarCategoryId.DefaultSetting = @"";
				
					colvarCategoryId.ForeignKeyTableName = "EventCategory";
				schema.Columns.Add(colvarCategoryId);
				
				TableSchema.TableColumn colvarCreatedBy = new TableSchema.TableColumn(schema);
				colvarCreatedBy.ColumnName = "CreatedBy";
				colvarCreatedBy.DataType = DbType.String;
				colvarCreatedBy.MaxLength = 50;
				colvarCreatedBy.AutoIncrement = false;
				colvarCreatedBy.IsNullable = true;
				colvarCreatedBy.IsPrimaryKey = false;
				colvarCreatedBy.IsForeignKey = false;
				colvarCreatedBy.IsReadOnly = false;
				colvarCreatedBy.DefaultSetting = @"";
				colvarCreatedBy.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCreatedBy);
				
				TableSchema.TableColumn colvarCreatedOn = new TableSchema.TableColumn(schema);
				colvarCreatedOn.ColumnName = "CreatedOn";
				colvarCreatedOn.DataType = DbType.DateTime;
				colvarCreatedOn.MaxLength = 0;
				colvarCreatedOn.AutoIncrement = false;
				colvarCreatedOn.IsNullable = true;
				colvarCreatedOn.IsPrimaryKey = false;
				colvarCreatedOn.IsForeignKey = false;
				colvarCreatedOn.IsReadOnly = false;
				colvarCreatedOn.DefaultSetting = @"";
				colvarCreatedOn.ForeignKeyTableName = "";
				schema.Columns.Add(colvarCreatedOn);
				
				TableSchema.TableColumn colvarLastModifiedBy = new TableSchema.TableColumn(schema);
				colvarLastModifiedBy.ColumnName = "LastModifiedBy";
				colvarLastModifiedBy.DataType = DbType.String;
				colvarLastModifiedBy.MaxLength = 50;
				colvarLastModifiedBy.AutoIncrement = false;
				colvarLastModifiedBy.IsNullable = true;
				colvarLastModifiedBy.IsPrimaryKey = false;
				colvarLastModifiedBy.IsForeignKey = false;
				colvarLastModifiedBy.IsReadOnly = false;
				colvarLastModifiedBy.DefaultSetting = @"";
				colvarLastModifiedBy.ForeignKeyTableName = "";
				schema.Columns.Add(colvarLastModifiedBy);
				
				TableSchema.TableColumn colvarLastModifiedOn = new TableSchema.TableColumn(schema);
				colvarLastModifiedOn.ColumnName = "LastModifiedOn";
				colvarLastModifiedOn.DataType = DbType.DateTime;
				colvarLastModifiedOn.MaxLength = 0;
				colvarLastModifiedOn.AutoIncrement = false;
				colvarLastModifiedOn.IsNullable = true;
				colvarLastModifiedOn.IsPrimaryKey = false;
				colvarLastModifiedOn.IsForeignKey = false;
				colvarLastModifiedOn.IsReadOnly = false;
				colvarLastModifiedOn.DefaultSetting = @"";
				colvarLastModifiedOn.ForeignKeyTableName = "";
				schema.Columns.Add(colvarLastModifiedOn);
				
				BaseSchema = schema;
				//add this schema to the provider
				//so we can query it later
				DataService.Providers["WaEvent"].AddSchema("iEvent",schema);
			}
		}
		#endregion
		
		#region Props
		  
		[XmlAttribute("Id")]
		[Bindable(true)]
		public int Id 
		{
			get { return GetColumnValue<int>(Columns.Id); }
			set { SetColumnValue(Columns.Id, value); }
		}
		  
		[XmlAttribute("Title")]
		[Bindable(true)]
		public string Title 
		{
			get { return GetColumnValue<string>(Columns.Title); }
			set { SetColumnValue(Columns.Title, value); }
		}
		  
		[XmlAttribute("EventDate")]
		[Bindable(true)]
		public DateTime? EventDate 
		{
			get { return GetColumnValue<DateTime?>(Columns.EventDate); }
			set { SetColumnValue(Columns.EventDate, value); }
		}
		  
		[XmlAttribute("Description")]
		[Bindable(true)]
		public string Description 
		{
			get { return GetColumnValue<string>(Columns.Description); }
			set { SetColumnValue(Columns.Description, value); }
		}
		  
		[XmlAttribute("HostedBy")]
		[Bindable(true)]
		public string HostedBy 
		{
			get { return GetColumnValue<string>(Columns.HostedBy); }
			set { SetColumnValue(Columns.HostedBy, value); }
		}
		  
		[XmlAttribute("Phone")]
		[Bindable(true)]
		public string Phone 
		{
			get { return GetColumnValue<string>(Columns.Phone); }
			set { SetColumnValue(Columns.Phone, value); }
		}
		  
		[XmlAttribute("Address")]
		[Bindable(true)]
		public string Address 
		{
			get { return GetColumnValue<string>(Columns.Address); }
			set { SetColumnValue(Columns.Address, value); }
		}
		  
		[XmlAttribute("Lat")]
		[Bindable(true)]
		public decimal? Lat 
		{
			get { return GetColumnValue<decimal?>(Columns.Lat); }
			set { SetColumnValue(Columns.Lat, value); }
		}
		  
		[XmlAttribute("Lng")]
		[Bindable(true)]
		public decimal? Lng 
		{
			get { return GetColumnValue<decimal?>(Columns.Lng); }
			set { SetColumnValue(Columns.Lng, value); }
		}
		  
		[XmlAttribute("CountryId")]
		[Bindable(true)]
		public int? CountryId 
		{
			get { return GetColumnValue<int?>(Columns.CountryId); }
			set { SetColumnValue(Columns.CountryId, value); }
		}
		  
		[XmlAttribute("CategoryId")]
		[Bindable(true)]
		public int? CategoryId 
		{
			get { return GetColumnValue<int?>(Columns.CategoryId); }
			set { SetColumnValue(Columns.CategoryId, value); }
		}
		  
		[XmlAttribute("CreatedBy")]
		[Bindable(true)]
		public string CreatedBy 
		{
			get { return GetColumnValue<string>(Columns.CreatedBy); }
			set { SetColumnValue(Columns.CreatedBy, value); }
		}
		  
		[XmlAttribute("CreatedOn")]
		[Bindable(true)]
		public DateTime? CreatedOn 
		{
			get { return GetColumnValue<DateTime?>(Columns.CreatedOn); }
			set { SetColumnValue(Columns.CreatedOn, value); }
		}
		  
		[XmlAttribute("LastModifiedBy")]
		[Bindable(true)]
		public string LastModifiedBy 
		{
			get { return GetColumnValue<string>(Columns.LastModifiedBy); }
			set { SetColumnValue(Columns.LastModifiedBy, value); }
		}
		  
		[XmlAttribute("LastModifiedOn")]
		[Bindable(true)]
		public DateTime? LastModifiedOn 
		{
			get { return GetColumnValue<DateTime?>(Columns.LastModifiedOn); }
			set { SetColumnValue(Columns.LastModifiedOn, value); }
		}
		
		#endregion
		
		
		#region PrimaryKey Methods		
		
        protected override void SetPrimaryKey(object oValue)
        {
            base.SetPrimaryKey(oValue);
            
            SetPKValues();
        }
        
		
		private WaEvent.Generated.EventCommentCollection colEventCommentRecords;
		public WaEvent.Generated.EventCommentCollection EventCommentRecords()
		{
			if(colEventCommentRecords == null)
			{
				colEventCommentRecords = new WaEvent.Generated.EventCommentCollection().Where(EventComment.Columns.EventId, Id).Load();
				colEventCommentRecords.ListChanged += new ListChangedEventHandler(colEventCommentRecords_ListChanged);
			}
			return colEventCommentRecords;
		}
				
		void colEventCommentRecords_ListChanged(object sender, ListChangedEventArgs e)
		{
            if (e.ListChangedType == ListChangedType.ItemAdded)
            {
		        // Set foreign key value
		        colEventCommentRecords[e.NewIndex].EventId = Id;
            }
		}
		private WaEvent.Generated.FollowCollection colFollowRecords;
		public WaEvent.Generated.FollowCollection FollowRecords()
		{
			if(colFollowRecords == null)
			{
				colFollowRecords = new WaEvent.Generated.FollowCollection().Where(Follow.Columns.EventId, Id).Load();
				colFollowRecords.ListChanged += new ListChangedEventHandler(colFollowRecords_ListChanged);
			}
			return colFollowRecords;
		}
				
		void colFollowRecords_ListChanged(object sender, ListChangedEventArgs e)
		{
            if (e.ListChangedType == ListChangedType.ItemAdded)
            {
		        // Set foreign key value
		        colFollowRecords[e.NewIndex].EventId = Id;
            }
		}
		#endregion
		
			
		
		#region ForeignKey Properties
		
		/// <summary>
		/// Returns a EventCategory ActiveRecord object related to this IEvent
		/// 
		/// </summary>
		public WaEvent.Generated.EventCategory EventCategory
		{
			get { return WaEvent.Generated.EventCategory.FetchByID(this.CategoryId); }
			set { SetColumnValue("CategoryId", value.CategoryId); }
		}
		
		
		#endregion
		
		
		
		//no ManyToMany tables defined (0)
		
        
        
		#region ObjectDataSource support
		
		
		/// <summary>
		/// Inserts a record, can be used with the Object Data Source
		/// </summary>
		public static void Insert(string varTitle,DateTime? varEventDate,string varDescription,string varHostedBy,string varPhone,string varAddress,decimal? varLat,decimal? varLng,int? varCountryId,int? varCategoryId,string varCreatedBy,DateTime? varCreatedOn,string varLastModifiedBy,DateTime? varLastModifiedOn)
		{
			IEvent item = new IEvent();
			
			item.Title = varTitle;
			
			item.EventDate = varEventDate;
			
			item.Description = varDescription;
			
			item.HostedBy = varHostedBy;
			
			item.Phone = varPhone;
			
			item.Address = varAddress;
			
			item.Lat = varLat;
			
			item.Lng = varLng;
			
			item.CountryId = varCountryId;
			
			item.CategoryId = varCategoryId;
			
			item.CreatedBy = varCreatedBy;
			
			item.CreatedOn = varCreatedOn;
			
			item.LastModifiedBy = varLastModifiedBy;
			
			item.LastModifiedOn = varLastModifiedOn;
			
		
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}
		
		/// <summary>
		/// Updates a record, can be used with the Object Data Source
		/// </summary>
		public static void Update(int varId,string varTitle,DateTime? varEventDate,string varDescription,string varHostedBy,string varPhone,string varAddress,decimal? varLat,decimal? varLng,int? varCountryId,int? varCategoryId,string varCreatedBy,DateTime? varCreatedOn,string varLastModifiedBy,DateTime? varLastModifiedOn)
		{
			IEvent item = new IEvent();
			
				item.Id = varId;
			
				item.Title = varTitle;
			
				item.EventDate = varEventDate;
			
				item.Description = varDescription;
			
				item.HostedBy = varHostedBy;
			
				item.Phone = varPhone;
			
				item.Address = varAddress;
			
				item.Lat = varLat;
			
				item.Lng = varLng;
			
				item.CountryId = varCountryId;
			
				item.CategoryId = varCategoryId;
			
				item.CreatedBy = varCreatedBy;
			
				item.CreatedOn = varCreatedOn;
			
				item.LastModifiedBy = varLastModifiedBy;
			
				item.LastModifiedOn = varLastModifiedOn;
			
			item.IsNew = false;
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}
		#endregion
        
        
        
        #region Typed Columns
        
        
        public static TableSchema.TableColumn IdColumn
        {
            get { return Schema.Columns[0]; }
        }
        
        
        
        public static TableSchema.TableColumn TitleColumn
        {
            get { return Schema.Columns[1]; }
        }
        
        
        
        public static TableSchema.TableColumn EventDateColumn
        {
            get { return Schema.Columns[2]; }
        }
        
        
        
        public static TableSchema.TableColumn DescriptionColumn
        {
            get { return Schema.Columns[3]; }
        }
        
        
        
        public static TableSchema.TableColumn HostedByColumn
        {
            get { return Schema.Columns[4]; }
        }
        
        
        
        public static TableSchema.TableColumn PhoneColumn
        {
            get { return Schema.Columns[5]; }
        }
        
        
        
        public static TableSchema.TableColumn AddressColumn
        {
            get { return Schema.Columns[6]; }
        }
        
        
        
        public static TableSchema.TableColumn LatColumn
        {
            get { return Schema.Columns[7]; }
        }
        
        
        
        public static TableSchema.TableColumn LngColumn
        {
            get { return Schema.Columns[8]; }
        }
        
        
        
        public static TableSchema.TableColumn CountryIdColumn
        {
            get { return Schema.Columns[9]; }
        }
        
        
        
        public static TableSchema.TableColumn CategoryIdColumn
        {
            get { return Schema.Columns[10]; }
        }
        
        
        
        public static TableSchema.TableColumn CreatedByColumn
        {
            get { return Schema.Columns[11]; }
        }
        
        
        
        public static TableSchema.TableColumn CreatedOnColumn
        {
            get { return Schema.Columns[12]; }
        }
        
        
        
        public static TableSchema.TableColumn LastModifiedByColumn
        {
            get { return Schema.Columns[13]; }
        }
        
        
        
        public static TableSchema.TableColumn LastModifiedOnColumn
        {
            get { return Schema.Columns[14]; }
        }
        
        
        
        #endregion
		#region Columns Struct
		public struct Columns
		{
			 public static string Id = @"Id";
			 public static string Title = @"Title";
			 public static string EventDate = @"EventDate";
			 public static string Description = @"Description";
			 public static string HostedBy = @"HostedBy";
			 public static string Phone = @"Phone";
			 public static string Address = @"Address";
			 public static string Lat = @"Lat";
			 public static string Lng = @"Lng";
			 public static string CountryId = @"CountryId";
			 public static string CategoryId = @"CategoryId";
			 public static string CreatedBy = @"CreatedBy";
			 public static string CreatedOn = @"CreatedOn";
			 public static string LastModifiedBy = @"LastModifiedBy";
			 public static string LastModifiedOn = @"LastModifiedOn";
						
		}
		#endregion
		
		#region Update PK Collections
		
        public void SetPKValues()
        {
                if (colEventCommentRecords != null)
                {
                    foreach (WaEvent.Generated.EventComment item in colEventCommentRecords)
                    {
                        if (item.EventId == null ||item.EventId != Id)
                        {
                            item.EventId = Id;
                        }
                    }
               }
		
                if (colFollowRecords != null)
                {
                    foreach (WaEvent.Generated.Follow item in colFollowRecords)
                    {
                        if (item.EventId == null ||item.EventId != Id)
                        {
                            item.EventId = Id;
                        }
                    }
               }
		}
        #endregion
    
        #region Deep Save
		
        public void DeepSave()
        {
            Save();
            
                if (colEventCommentRecords != null)
                {
                    colEventCommentRecords.SaveAll();
               }
		
                if (colFollowRecords != null)
                {
                    colFollowRecords.SaveAll();
               }
		}
        #endregion
	}
}
